var globals = {
    host: 'ws://localhost:9000/gomoku/server/main.php'
};

$(document).ready(function()
{
    if (window.WebSocket === undefined)
    {
        apprise('Websocket is not supported :(', {'animate':true});
    }
    else
    {
        setPlayerName();
    }
});

function setPlayerName()
{
    apprise('What\'s your name?',
        {'input':true, 'animate':true},
        function (r)
        {
            if (r && r !== '' && r.indexOf(',') === -1 && r.length < 10)
            {
                objWebSocket.init(objWebSocket, r);
            }
            else
            {
                setPlayerName();
            }
        });
}
